#ifndef ALIYUN_HTTP_HELPER_H_
#define ALIYUN_HTTP_HELPER_H_

#include <map>
#include "core/utils/string_helper.h"

namespace aliyun {

class HttpResponse;

class HttpHelper {
public:
  // config
  static int    connect_timeout_ms; // default 30000
  static int    read_timeout_ms;    // default 80000
  static bool   enable_proxy;       // default false
  static string proxy_ip;           // default empty string, depends enable_proxy=true
  static int    proxy_port;         // default 0, depends enable_proxy=true

  static HttpResponse* GetResponse(const string& url, const string& method = "GET",
    const string* post_fields = NULL, const std::map<string, string> *headers = NULL);

  static void ReleaseResponse(HttpResponse *response);

};

} // namespace aliyun {

#endif // #ifndef ALIYUN_HTTP_HELPER_H_

// end of file
